package com.amit.client.domain;

import com.amit.entities.StudentEntity;

import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: AD
 * Date: 08/01/13
 * Time: 11:17
 */

public class LectureVO {
    private Long id;
    private Set<StudentEntity> students;
    private String name;

    public LectureVO(Long id, Set<StudentEntity> students, String name) {
        this.id = id;
        this.students = students;
        this.name = name;
    }

    public LectureVO() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Set<StudentEntity> getStudents() {
        return students;
    }

    public void setStudents(Set<StudentEntity> students) {
        this.students = students;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LectureVO lectureVO = (LectureVO) o;

        return !(id != null ? !id.equals(lectureVO.id) : lectureVO.id != null) &&
                !(name != null ? !name.equals(lectureVO.name) : lectureVO.name != null) &&
                !(students != null ? !students.equals(lectureVO.students) : lectureVO.students != null);
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (students != null ? students.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }
}
